Drupal.questQuestionForm = function() {
  jQuery('select.quest_type').change(function(){
    switch (this.value) {
      case 'multichoice':
        jQuery('.quest_answers').show();
        jQuery('.quest_correct_answers').show();
        jQuery('.quest_answer_images').show();
        break;
      case 'free-text':
        jQuery('.quest_answers').hide();
        jQuery('.quest_correct_answers').hide();
        jQuery('.quest_answer_images').hide();
        break;
      case 'free-options':
        jQuery('.quest_answers').show();
        jQuery('.quest_correct_answers').hide();
        jQuery('.quest_answer_images').show();
        break;
    }
  }).trigger('change');
}

// Global killswitch
if (Drupal.jsEnabled) {
  $(document).ready(Drupal.questQuestionForm);
}
